﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="hoidongAddMember.ascx.cs" Inherits="uicontrol_hoidongAddMemberl" %>
<asp:SqlDataSource ID="hoidong" runat="server" ConnectionString="<%$ ConnectionStrings:evaConn %>"
      SelectCommand="SELECT * FROM HoiDong_All WHERE MaDoanhNghiep=@MaDoanhNghiep">            
      <SelectParameters>
        <asp:SessionParameter Name="MaDoanhNghiep" SessionField="CompanyID" />
      </SelectParameters>
</asp:SqlDataSource>        
<asp:SqlDataSource ID="thanhvientohoidong" runat="server" ConnectionString="<%$ ConnectionStrings:evaConn %>"
            SelectCommand="SELECT * FROM [ThanhVien_All]">
</asp:SqlDataSource>
<table width="600px">
    <tr>
        <td>
            <asp:Label ID="Label7" runat="server" CssClass="LabelTitle" Text="THÊM THÀNH VIÊN VÀO HỘI ĐỒNG"></asp:Label></td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td style="text-align:left"><asp:Label ID="Label1" Text="Vui lòng chọn Hội đồng tương ứng muốn thêm thành viên :" runat="server" CssClass="Label"></asp:Label></td>
    </tr>
    <tr>
        <td>
            <table width="100%">
                <tr>
                    <td style="width:20%; text-align:left; vertical-align:top" ><asp:Label ID="lblHD" Text="Hội đồng :" runat="server" CssClass="Label"></asp:Label></td>
                    <td style="width:30%; text-align:left; vertical-align:top">
                        <asp:DropDownList ID="ddlHoiDong" runat="server" DataSourceID="hoidong" DataTextField="TenHoiDong" DataValueField="MaHoiDong" AutoPostBack="false" CssClass="DropdownList" TabIndex="1">
                        </asp:DropDownList><br />
                        <asp:Button ID="btnChon" runat="server" OnClick="btnChon_Click" Text="Chọn" TabIndex="2" />
                        <asp:Button ID="btnHDKhac" runat="server" Text="Hội đồng khác" OnClick="btnHDKhac_Click" Visible="False" TabIndex="3" /></td>
                    <td valign="top" style="height: 25px">
                        <asp:DetailsView ID="dtvHoiDong" runat="server" AutoGenerateRows="False" Width="100%" CssClass="Grv" >
                            <Fields>
                                <asp:BoundField HeaderText="T&#234;n Hội Đồng" DataField="TenHoiDong" Visible="False"/>
                                <asp:BoundField HeaderText="Ng&#224;y th&#224;nh lập" DataField="NgayThanhLap" Visible="False"/>
                                <asp:BoundField HeaderText="Quyết định" DataField="QuyetDinh" />
                                <asp:BoundField HeaderText="Người k&#253;" DataField="NguoiKy" />
                                <asp:BoundField HeaderText="T&#234;n Doanh nghiệp" DataField="TenDoanhNghiep" />
                            </Fields>
                            <RowStyle CssClass="GrvRowStyle" />
                            <FieldHeaderStyle CssClass="GrvHeader" />                            
                            <AlternatingRowStyle CssClass="GrvAlternatingRowStyle" />
                        </asp:DetailsView>
                    </td>
                </tr>    
            </table>
            
        </td>
    </tr>
    <tr>
        <td>
            <asp:Panel ID="pnlInfo" Visible="false" runat="server" Width="100%">
            <table>
                <tr>
                    <td>
                        <asp:Label id="Label2" runat="server" Text="Các thành viên có thể chọn :" CssClass="Label"></asp:Label></td>
                </tr>
                <tr>
                    <td>
                        <asp:GridView ID="grvThanhVien" runat="server" AllowPaging="True" AllowSorting="True"
                            DataSourceID="thanhvientohoidong" OnSelectedIndexChanged="grvThanhVien_SelectedIndexChanged" PageSize="5" OnRowDataBound="grvThanhVien_RowDataBound" TabIndex="4" Width="598px">
                            <Columns>
                                <asp:CommandField ShowSelectButton="True" HeaderText="Chọn" SelectText="Th&#234;m" ButtonType="Button" />  
                            </Columns>
                            <PagerStyle CssClass="GrvPagerStyle"/>
                            <HeaderStyle CssClass="GrvHeader" ForeColor="White" />
                            <RowStyle CssClass="GrvRowStyle"/>
                            <AlternatingRowStyle CssClass="GrvAlternatingRowStyle" />
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblThemNotice" runat="server" CssClass="LabelNotify"></asp:Label></td>
                </tr>
                <tr>
                    <td><asp:Label ID="tv" Text="Danh sách các Thành viên hiện có trong Hội đồng :" runat="server" CssClass="Label"></asp:Label></td>
                </tr>
                <tr>
                    <td>
                        <asp:GridView ID="grvTVtrongHD" runat="server" AllowPaging="True" PageSize="5" AutoGenerateColumns="False" OnRowDataBound="grvTVtrongHD_RowDataBound" OnPageIndexChanging="grvTVtrongHD_PageIndexChanging" OnRowDeleting="grvTVtrongHD_RowDeleting" TabIndex="5" Width="598px">
                            <Columns>
                                <asp:BoundField DataField="MaHoiDongChamDiem" HeaderText="MHDCD" />
                                <asp:BoundField DataField="TenThanhVien" HeaderText="T&#234;n th&#224;nh vi&#234;n" />
                                <asp:BoundField DataField="TenViTri" HeaderText="Vị tr&#237;" />
                                <asp:BoundField DataField="TenDoanhNghiep" HeaderText="Doanh nghiệp" />
                                <asp:CommandField DeleteText="Loại bỏ" HeaderText="Loại TV" DeleteImageUrl="~/App_Themes/Default/Css/images/delete.gif" ButtonType="Image" ShowCancelButton="False" ShowDeleteButton="True"/>
                            </Columns>
                            <PagerStyle CssClass="GrvPagerStyle"/>
                            <HeaderStyle CssClass="GrvHeader" ForeColor="white" />
                            <RowStyle CssClass="GrvRowStyle"/>
                            <AlternatingRowStyle CssClass="GrvAlternatingRowStyle" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
           </asp:Panel>
        </td>
    </tr>    
</table>